package com.say.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.say.bean.domain.User;
import com.say.service.FriendsService;
import com.say.service.UserService;
import com.say.utils.UserUtil;

@Controller
@RequestMapping("/wensay/friends")
public class ApiFriendsController extends BaseController {
	
	@Autowired
	protected UserService userService;
	
	@Autowired
	protected FriendsService friendsService;
	
	
	//好友页面
	@RequestMapping()
	public String friends(Model model){
		User user = UserUtil.getUser(request);
		List<User> users=userService.findFriendsByUserId(user.getId());
		model.addAttribute("user", user);
		model.addAttribute("users", users);
		return "wensay/friends";
	}

	
	


}
